# Contributor: viest <dev@service.viest.me>
# Maintainer: Chitao.Gao <neeke@php.net>
pkgname=php7-pecl-seaslog
_extname=seaslog
pkgver=2.2.0
pkgrel=0
pkgdesc="An effective, fast, stable log extension for PHP 7."
url="https://pecl.php.net/package/SeasLog"
arch="all"
license="PHP-3.01"
depends="php7-json"
makedepends="php7-dev re2c"
source="php-pecl-$_extname-$pkgver.tar.gz::https://pecl.php.net/get/SeasLog-$pkgver.tgz"
builddir="$srcdir"/SeasLog-$pkgver

build() {
	phpize7
	./configure \
		--prefix=/usr \
		--with-php-config=/usr/bin/php-config7
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test \
		PHP_TEST_SHARED_EXTENSIONS=" \
		-d extension=/usr/lib/php7/modules/json.so \
		-d extension=modules/$_extname.so"
	php7 -dextension=modules/$_extname.so --ri $_extname
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/php7/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="5c1d7dd6641bd8b8f3bf2c52f4b427103643fa1b7407a89769de7f450e882f9a1484b5b8b1aecf13c8060966b3bbcb52cbaf1536b93a8bceca5104bfda547629  php-pecl-seaslog-2.2.0.tar.gz"
